<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>测试</title>
<style>
    /**清理边距**/
    body,h1,h2,h3,h4,h5,h6,hr,p,blockquote,dl,dt,dd,ul,ol,li,pre,form,fieldset,legend,button,input,textarea,th,td { margin:0px; padding:0px; }
    /**默认字体**/
    body,button,input,select,textarea { font:12px/1.5 宋体,arial,sans-serif; }
    h1,h2,h3,h4,h5,h6 { font-size:100%; }
    address,cite,dfn,em,var { font-style:normal; }
    code,kbd,pre,samp { font-family:courier new,courier,monospace; }
    small { font-size:12px; }
    ul,ol,li { list-style:none; }
    a { text-decoration:none; }
    a:hvoer { text-decoration:underline; }
    sup { vertical-align:text-top; }
    sub { vertical-align:text-bottom; }
    legend { color:#000; }
    fieldset,img { border:0px; }
    button,input,select,textarea{ font-size:100%; }
    table { border-collapse:collapse; border-spacing:0; }
    /**重置**/
    .invisible { visibility:hidden; }
    .noBg { background:none !important; }
    .clear { display:block; height:0; overflow:hidden; clear:both; }
    .clearfix:after { content:'\20'; display:block; height:0; clear:both; }
    .clearfix { *zoom:1; }
    /**页面样式**/
    .hidden { display:none; }
    .wmenu {height:500px;width:190px; border:1px solid #d1d1d1; background:#f3f3f3;}
    .wmenu dl{border-bottom:1px solid #d1d1d1; }
    .wmenu dt ,div{height:41px;line-height:41px;border-bottom:1px solid #d1d1d1; text-align:left; background-position:153px -56px;}
    .wmenu dt a ,div{display:block; padding-left:20px; font-size:16px; color:#444343;}
    .wmenu dt.user a{ background-position:18px -22px;}
    .wmenu dt.edit a{ background-position:18px 12px;}
    .icotop { border:none !important; background-position:153px -90px !important;}
    .wmenu dd {line-height:37px;}
    .wmenu dd a{display:block;padding-left:50px; font-size:14px; color:#362c30;}
    .wmenu dd a:hover ,a.currcent{display:block;padding-left:50px; color:#fff !important;background-repeat:repeat-x;background-position:left bottom;}
</style>
</head>
<body>
<div class="wmenu">



</div>
<script src="resources/resources/scripts/jquery-1.7.1.min.js"></script>
<script type="text/javascript">
var id = "";
var userId = "";
var provinceCode = "";
$(function() {
    $.ajax({
        url:"/getSession",
        async:false,
        dataType:"json",
        type:"post",
        success:function(data) {
            userId = data;
        }
    })
    if(userId==-1){
        $(".wmenu").empty();
        html = '<div >请先<a onclick="window.parent.location.href=\'/toDengLu\'">登录</a></div>';
        $(".wmenu").append(html);
        return
    }
    $.ajax({
        url:"/getSessionProvince",
        async:false,
        dataType:"json",
        type:"post",
        success:function(data) {
            provinceCode = data;
        }
    })
   $.ajax({
      url:"/loadPersonalInformationCheckShow",
      async:false,
      dataType:"json",
      type:"post",
      data:{userId:userId},
      success:function(data) {
          if(data.list!=""&&data.list!=null&&data.list.length>0)
             id = data.list[0].id;
      }
   })
   $.ajax({
      url:"/getSessionGrade",
      async:false,
      dataType:"json",
      type:"post",
      success:function(data) {
          var html = "";
          if(data==0){
              $(".wmenu").empty();
              html = '<div ><a onclick="window.parent.right.location.href=\'/toMoFang\'">首页</a></div>'+
                     '<div ><a onclick="jump()">信息填写</a></div>'+
                     '<div><a onclick="window.parent.right.location.href=\'/toPersonalMessageCheckShow\'">审核信息</a></div>'+
                     '<div><a onclick="window.parent.location.href=\'/toLogout\'">退出</a></div>';
          }else if (data==1||data==2||data==3) {
              //TODO
              $(".wmenu").empty();
              html = '<dt ><a onclick="window.parent.right.location.href=\'/toMoFang\'">首页</a></dt>'+
                     '<dt ><a onclick="jump()">信息填写</a></dt>'+
                     '<dt><a onclick="window.parent.right.location.href=\'/toPersonalMessageCheckShow\'">审核信息</a></dt>'+
                     '<dl>'+
                     '<dt class="user"><a onclick="window.parent.right.location.href=\'/toRegisterCheck\'">注册审核</a></dt>'+
                     '</dl>'+
                     '<dl>'+
                     '<dt class="user"><a onclick="window.parent.right.location.href=\'/toAccountManager\'">账户管理</a></dt>'+
                     '</dl>'+
                     '<dl>'+
                     '<dt class="user"><a onclick="window.parent.right.location.href=\'/toPersonalMessageCheck\'">登记信息审核</a></dt>'+
                     '</dl>'+
                     '<dl>'+
                     '<dt class="user"><a onclick="window.parent.right.location.href=\'/toInformation?id='+userId+'\'">流动人口信息管理</a></dt>'+
                     '</dl>'+
                     '<dl>'+
                     '<dt><a onclick="window.parent.right.location.href=\'/toPersonCalculate?provinceCode='+provinceCode+'\'">流动人口信息统计</a></dt>'+
                     '<dt><a onclick="window.parent.location.href=\'/toLogout\'">退出</a></dt>'+
                     '</dl>';
          }else {
              $(".wmenu").empty();
              html = '<div >请先<a onclick="window.parent.location.href=\'/toDengLu\'">登录</a></div>';
          }
          $(".wmenu").append(html);
      }
   })

})
$('.wmenu dl dt').click(function(){
    $(this).toggleClass('icotop');
    $(this).siblings('dd').toggleClass('hidden');
});
function jump() {
    if(id!=""&&id!=null&&id!=undefined){
        window.parent.right.location.href='/toPersonalInformation?id='+id;
    }else {
        window.parent.right.location.href='/toPersonalInformation';
    }
}
</script>
</body>
</html>